# Maintainer: Maxime Gauduin <alucryd@archlinux.org>

pkgname=orcania
pkgver=2.3.2
pkgrel=1
pkgdesc='Potluck with different functions for different purposes that can be shared among C programs'
arch=(loong64 x86_64)
url=https://github.com/babelouest/orcania
license=(LGPL2.1)
depends=(
  glibc
)
makedepends=(
  cmake
  doxygen
  git
  graphviz
  ninja
)
provides=(liborcania.so)
_tag=21a4d797960066dda50d95f284fb467445bea722
source=(git+https://github.com/babelouest/orcania.git#tag=${_tag})
validpgpkeys=(8405B02FCC28EF9744C8F253FE82139440BD22B9) # Nicolas Mora <nicolas@babelouest.org>
b2sums=(SKIP)

pkgver() {
  cd orcania
  git describe --tags | sed 's/^v//'
}

build() {
  cmake -S orcania -B build -G Ninja \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_ORCANIA_DOCUMENTATION=ON
  ninja -C build doc
}

package() {
  DESTDIR="${pkgdir}" ninja -C build install
  install -dm 755 "${pkgdir}"/usr/share/doc/orcania
  cp -dr --no-preserve=ownership orcania/doc/html "${pkgdir}"/usr/share/doc/orcania/
}

# vim: ts=2 sw=2 et:
